//全局路由守卫
import router from '@/router';
import setting from './setting';
//@ts-ignore
import nprogress from 'nprogress';
import 'nprogress/nprogress.css';
// 注释掉这个空的路由守卫，因为它会干扰router/index.ts中的守卫
// router.beforeEach((to, from, next) => {
//   nprogress.start();
//   //添加逻辑
//
//   next();
// });

// 只保留进度条和标题设置
router.beforeEach(() => {
  nprogress.start();
});

router.afterEach((to: any, from: any) => {
  document.title = `${setting.title}-${to.meta.title}` 
  nprogress.done();
});